<?php
$GLOBALS['Md'] = "RHUSJW24";
$GLOBALS['Pd'] = "B";
require_once($_SERVER['DOCUMENT_ROOT']."/defaultconf.mex");
require_once($GLOBALS['PAD']."Modules/RHUSJW24/modconf.mex"); 
MYTCONN();
	//=======================================================
	// Generate Package
?>
<table width="100%"  border="0" cellpadding="1" cellspacing="1">
  <tr>
    <td colspan="2"><table width="100%"  border="0" cellpadding="3" cellspacing="1">
        <tr bgcolor="#9CB8C9">
          <td width="40%" bgcolor="#DDDCBB"><b>Gerenciador de Funcionários </b></td>
        </tr>
      </table>
        <table width="100%"  border="0" cellpadding="3" cellspacing="1">
          <tr bgcolor="#9CB8C9">
            <td width="300" bgcolor="#9CB8C9" align="center"><a href="<?php echo $_SERVER['PHP_SELF'];?>?VW=Pack">Funcionários</a></td>
            <td width="300" bgcolor="#9CB8C9" align="center">&nbsp;</td>
            <td width="300" bgcolor="#9CB8C9" align="center">&nbsp;</td>
            <td width="50%" bgcolor="#9CB8C9">&nbsp;</td>
          </tr>
      </table></td>
  </tr>
  <tr>
    <td valign="top" bgcolor="#F2F2F2">
	<?php form_pr('RH_Offices','',$_SERVER['PHP_SELF'],'post'); ?>
      <table width="300"  border="0" cellpadding="3" cellspacing="1">
          <tr bgcolor="#E5E5E5">
            <td colspan="2" valign="top">Departamentos:
			<?php mn_field('button','ED','Office_NW','Novo Departamento','','','',''); ?></td>
          </tr>
      </table>
	 </form>
      <DIV id="DOM">
        <?php
		 $Qur = "SELECT ref AS ID, name AS NAME FROM main_offices";
		 mn_field('select','ED','SYSOffices','',$Qur,'','False',' " multiple size="6"');
		 ?>
    </DIV></td>
    <td width="100%" valign="top"><table width="100%"  border="0" cellpadding="3" cellspacing="1">
        <tr bgcolor="#E5E5E5">
          <td colspan="5" valign="top">Funcionários
          <?php mn_field('button','ED','NWDomain','Novo Dominio','','','',''); ?></td>
        </tr>
      </table>
        <DIV id="ORI">
          <?php include($MODPAD.'Lib/elem_user.mex'); ?>
        </DIV>
        <br>
        <table width="100%"  border="0" cellpadding="3" cellspacing="1">
          <tr bgcolor="#F9F9F9">
            <td valign="top"><span class="style1">Numero</span><span class="style1"></span></td>
            <td><span class="style1">Nome</span></td>
            <td>Username</td>
            <td>Tipo</td>
            <td>Provincia</td>
            <td>Cidade</td>
            <td>Caixa</td>
            <td>Estado</td>
          </tr>
          <?php
	$RT = $GLOBALS['MYT']->db_array("SELECT
				*
				FROM main_users
		WHERE main_users.Type != 5
		ORDER BY name ASC");
	for ($rt = 1; $rt <= $RT[0]; $rt++) { ?>
          <tr bgcolor="#F2F2F2">
            <td valign="top"><?php echo $RT[$rt]['ref'];?></td>
            <td><?php echo $RT[$rt]['name'];?></td>
            <td><?php echo $RT[$rt]['username'];?></td>
            <td><?php echo $RT[$rt]['Type'];?></td>
            <td><?php echo date("Y-m-d H:i:s",$RT[$rt]['last_login']);?></td>
            <td></td>
            <td></td>
            <td></td>
          </tr>
          <?php } ?>
      </table>
	  </td>
  </tr>
</table>